const joi = require("joi");

const cate_id = joi.number().integer().min(1).required();
const content = joi.string().required();
const title = joi.string().required();
const img = joi.string().required();
const state = joi.number().required();

// 添加文章校验
exports.add_articl_schema = {
    body: {
        title,
        cate_id,
        content,
        img,
        state,
    },
};

// 根据id修改文章校验
exports.update_articl_schema = {
    body: {
        id: cate_id,
        title,
        cate_id,
        content,
        img,
        state,
    },
};

// 校验id
exports.id_articl_schema = {
    query: {
        id: cate_id,
    },
};